package org.example.controller;

import org.example.entity.Interviewer;
import org.example.models.R;
import org.example.service.InterviewerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/interviewer")
public class InterviewerController {
    @Autowired
    private InterviewerService interviewerService;

    @GetMapping("/find")
    public R<List<Interviewer>> find(){
        List<Interviewer> interviewers = interviewerService.queryAllInformation();
        if (interviewers.isEmpty()) {
            return R.error("没有面试官信息");
        }
        return R.success(interviewers);
    }
}
